<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/8/2 0002
 * Time: 15:27
 */

namespace app\api\controller;


use app\service\CategoryService;
use app\service\SupplierService;

/**
 * 供应商相关
 * @author   juzi
 * @blog    https://blog.csdn.net/juziaixiao
 * @version  0.0.1
 * @datetime 2020年7月22日10:57:35
 */
class Supplier extends Common
{
    /**
     * [__construct 构造方法]
     * @author   juzi
     * @blog    https://blog.csdn.net/juziaixiao
     * @version  0.0.1
     * @datetime 2020年7月22日10:57:35
     */
    public function __construct()
    {
        // 调用父类前置方法
        parent::__construct();
    }

    /*
     * 供应商申请入驻
     */
    public function AddInfo(){
        $params=$this->data_post;

        $params['relation_name']=$params['supplier_name'];
        $params['audit_status']=1;
        $params['from_client']=2;
        $check_data = [
            'where' => [['relation_phone', '=', $params['relation_phone']],],
            'table' => 'supplier',
            'params' => $params,
            'msg' => '手机号已被注册或正在审核请勿重复提交',
            'error_code' => 2001,
        ];

        CategoryService::CheckTitle($check_data);
        SupplierService::VeryDataClient($params);
        SupplierService::SaveSup($params);

        return json(DataReturn('提交成功，管理员正在审核', 0));

    }

    public function DelInfo()
    {

    }
}